#include <REGX52.H>
#include"Delay.h"
#include"LCD1602.H"
#include"Timer0.h"
#include"IR.H"


unsigned char a;
unsigned char b;
unsigned char num;
void main()
{

	LCD_Init();
	LCD_ShowString(1,1,"ADD COM  NUM");
	LCD_ShowString(2,1,"00  00   000");
	IR_INIT();
 	while(1)
	{
		if(IR_dataflag()|IR_repeatflag())
		{			
			a=addressflag();
			b=commendflag();
			LCD_ShowHexNum(2,1,a,2);
			LCD_ShowHexNum(2,5,b,2);
			
			if(commendflag()==IR_VOL_MINUS)
			{
				num--;
			}
			if(commendflag()==IR_VOL_ADD)
			{
				num++;
			}
			LCD_ShowNum(2,10,num,3);
			
		}
		
	}
}

